﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Mobile.FirstWebApplication.Business
{
    public static class CountryManager
    {
        public static List<Country> GetCountries()
        {
            List<Country> countries = new List<Country>();
            List<User> users = UserManager.GetUsers();
            if (users != null)
            {
                var q = from p in users
                        group p by p.Country
                        into g
                        select new Country(g.Key, g.Count());
                countries = q.ToList();
            }
            return countries;
        }
    }
}